UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LdPmOY3OKtDAU2XmYcYqCMgpJnh0RA28H2qReh4Ie5c=' 
WHERE 
  key_id = '2ef47b5350a2a7c96f6a0d6e80bd2fbb0083dfbced7a2a4cd0f2e763e912023f' 
  AND (
    token = 'LdPmOY3OKtDAU2XmYcYqCMgpJnh0RA28H2qReh4Ie5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037