UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XmsHIUAD2fPpt1vbDuIrHxo3fcc3Y+kpcwxQmhXok/w=' 
WHERE 
  key_id = 'c3dbdf53b0e326ee542b3c98ff77f68db2bd541fdb3b60a5ec616a0a7d214adf' 
  AND (
    token = 'XmsHIUAD2fPpt1vbDuIrHxo3fcc3Y+kpcwxQmhXok/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021