UPDATE 
  q_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uEREK/C3fujLFWYPPCskMWtm/KvikQ2934Xfeku7qJI=' 
WHERE 
  key_id = '15c41761f44641502599dfe7d1e842919ace4a0f051fdcccf83578f4f9216730' 
  AND (
    token = 'uEREK/C3fujLFWYPPCskMWtm/KvikQ2934Xfeku7qJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00214