UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PGZ3aHnOnuXh1uLl1ycOUdOWxfjI6E+Al3vk/OpEv+8=' 
WHERE 
  key_id = 'b5c0f8b66e4ccbfb75f1d5417c6193092a81602a78063917566dc4f2f1c0bb92' 
  AND (
    token = 'PGZ3aHnOnuXh1uLl1ycOUdOWxfjI6E+Al3vk/OpEv+8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018