UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rv9BxBFY5tftS1+/En/y+6hm+STqKdtmxEkUhyCSdUw='
WHERE
key_id = '0b0768552540ab1ac23daa759775b257f85f124c9efc813bc4ca4484632ba411'
AND (
token = 'Rv9BxBFY5tftS1+/En/y+6hm+STqKdtmxEkUhyCSdUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)