UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u7mIhtxPA7zy5NDyh7kuGV1mnLAXsbIau56vWF1u7EI=' 
WHERE 
  key_id = 'f8a498efbd6037b0706e7b06d6c34cdd8387cbc1c13efc207f7791bb03c37653' 
  AND (
    token = 'u7mIhtxPA7zy5NDyh7kuGV1mnLAXsbIau56vWF1u7EI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051