UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'grabE07KuqXrY5ddIhq2wLb0OCV/zzR722iJdkatWq8=' 
WHERE 
  key_id = '0e0f133ec9317647242cba25bc9f8eb2a9b074c37bcf93fc573a81844c533279' 
  AND (
    token = 'grabE07KuqXrY5ddIhq2wLb0OCV/zzR722iJdkatWq8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017