UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7oPSH4AUAd8WwYAgnBFR+1S26YexDHhVvr4pd8gT0uo=' 
WHERE 
  key_id = '739a6a2f14d9b4facf96133383c414f2c0fc820db444031c9984e74fec958887' 
  AND (
    token = '7oPSH4AUAd8WwYAgnBFR+1S26YexDHhVvr4pd8gT0uo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056