UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9vX9U4gtUHiKT4e9OS1TPrwiUzXOVZs6y+AW9xJSSHg=' 
WHERE 
  key_id = '73099510e86905e84c12f86dee6c0b133745564e2a116950c18d4acb6df89707' 
  AND (
    token = '9vX9U4gtUHiKT4e9OS1TPrwiUzXOVZs6y+AW9xJSSHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050