UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'alTZ61VNPHYgvKuRU2InMIKf/8OGmxpxv9Ubc5NgpYA=' 
WHERE 
  key_id = '85ff8677f9ffc19b0114e77117709893161dcdb6fb5ea6507ced5d962e7724ce' 
  AND (
    token = 'alTZ61VNPHYgvKuRU2InMIKf/8OGmxpxv9Ubc5NgpYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028