UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gh1soP90CBLs6aoVIDCFour9pCrfDBE/hEE5OZ2g3NM=' 
WHERE 
  key_id = '973b1938a728cd242803ef265a588a2f0530f690f0dc48dedc850f7c54f1e89b' 
  AND (
    token = 'Gh1soP90CBLs6aoVIDCFour9pCrfDBE/hEE5OZ2g3NM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031