UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kycq1UBigK2WrHTqEbRO0HzJW3Ms8aODk3QaBltg9mw='
WHERE
key_id = '6bd163bbec26f80a3e6e2f27901e3495b1552773baa8787a393ec685fd065b2c'
AND (
token = 'kycq1UBigK2WrHTqEbRO0HzJW3Ms8aODk3QaBltg9mw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)