UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NrKaRWNwKhy4FYwYmY0eW1jq+Q01SaH5LnEDe0sIjuo=' 
WHERE 
  key_id = '503ea9911544b6c878156195d6f92fc22c5c6a03d2714c10fc8e674a5a7b2f44' 
  AND (
    token = 'NrKaRWNwKhy4FYwYmY0eW1jq+Q01SaH5LnEDe0sIjuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039