UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wJCXOBJmd4k4OgrxXzxJSU439qMznB02XL2EBGlJT1g=' 
WHERE 
  key_id = '0179af951dc2b1d85d9f02b997d7a824896f6ace0f609f8fba193dffbd81d944' 
  AND (
    token = 'wJCXOBJmd4k4OgrxXzxJSU439qMznB02XL2EBGlJT1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027