UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OhDr+mZn2lldNfTavOdJcazYddH6O91mSniojtDV5bc=' 
WHERE 
  key_id = '84a3417e7ca8a50a8c0c9eff2406f367d1505928f6ff42c9d40bf932749725e6' 
  AND (
    token = 'OhDr+mZn2lldNfTavOdJcazYddH6O91mSniojtDV5bc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037