UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E2yIlsUKjMHbiCKZMxC7KNJAEBpIYT8NfxBTh2D7TdY=' 
WHERE 
  key_id = '2c4c9f61369fb72f35f833b1d970440953ba234592ec5497854b27c9f5935ca3' 
  AND (
    token = 'E2yIlsUKjMHbiCKZMxC7KNJAEBpIYT8NfxBTh2D7TdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055