UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TKH9bG4u+z97YHpbmYvzOg/25OcYe7GhxpSzz5UChTo=' 
WHERE 
  key_id = '3d6050c249c667e7b713f3a281668ced28ed99b012e1841bfa7f9e6eb76c2f0c' 
  AND (
    token = 'TKH9bG4u+z97YHpbmYvzOg/25OcYe7GhxpSzz5UChTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024