UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UbDzsY6Ocf6jqKOi4HiH1j1nXr/0xI/7RgnKjNJKivQ=' 
WHERE 
  key_id = '9bd1f514d999a432ad7723c11ab23605dfb949493a5436ec01b1d52ff2483f08' 
  AND (
    token = 'UbDzsY6Ocf6jqKOi4HiH1j1nXr/0xI/7RgnKjNJKivQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023