UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GvUicoq6rPiaMYG8UIqqUu1GSzsi44qPLhDhecA0RGI='
WHERE
key_id = '03b512ee373c60e292c4a9ba49043e3fb3509ddbd063000fa649155af7b99d26'
AND (
token = 'GvUicoq6rPiaMYG8UIqqUu1GSzsi44qPLhDhecA0RGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)