UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZTlk4RnWS5yKFdFPiFzft2z0AvmJw0/4QveB2rDEgcc=' 
WHERE 
  key_id = '4df1f105977564f9d0f4d8d0f150224d3c666cd348017d4f0c1636ef523b9696' 
  AND (
    token = 'ZTlk4RnWS5yKFdFPiFzft2z0AvmJw0/4QveB2rDEgcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038