UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MUdafeNfbMHqvWc+6w5xOzS2XMjhKXeEXsnHr1yO7Bo=' 
WHERE 
  key_id = 'f47153a990e2afa8ae06174180620c8a691ec11d4b787aaac2bea267da55417b' 
  AND (
    token = 'MUdafeNfbMHqvWc+6w5xOzS2XMjhKXeEXsnHr1yO7Bo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022