UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f5YNTx13RT04a8dLOfCGZk6sxi/iDcWE8B8FqLWMzvg=' 
WHERE 
  key_id = '644c24f13852c59eeb6e60b4f4f5d61e52011a41d48871f6674586541d422b59' 
  AND (
    token = 'f5YNTx13RT04a8dLOfCGZk6sxi/iDcWE8B8FqLWMzvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055