UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'STQp1cm69152BGCobwDkiVX/nJw3GvCEArhRD6F5GRk='
WHERE
key_id = '36bcbd22f16721c13d1e7f0e73c69dede712640907ed050b5cab493b42c57754'
AND (
token = 'STQp1cm69152BGCobwDkiVX/nJw3GvCEArhRD6F5GRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)