UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U91SJ0F+XuXTwwD1RLqSjT6RnDoK+/sCXey6DI9zLqA=' 
WHERE 
  key_id = '70ac78b087e439b6245c69305ee2fe503aec0b671ea66113b81e4d1c4b3be425' 
  AND (
    token = 'U91SJ0F+XuXTwwD1RLqSjT6RnDoK+/sCXey6DI9zLqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033