UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm7FirxRA4tRyXH98AycKKwtxx1llyL0iexLRWsI8PCE=' 
WHERE 
  key_id = '7c14121e679d6f3747451fb1192f87e81baec5b9c84e7819d772b5b790eb0a54' 
  AND (
    token = 'm7FirxRA4tRyXH98AycKKwtxx1llyL0iexLRWsI8PCE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026