UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U3sTVVi2xh0Nyo6LUgDTdcyQgzNSTQw9o9n/AXu9m94='
WHERE
key_id = 'c7a70e60269b6ba65e4648df84ac7102875292d4383a4ec346981ac6bd5a2efe'
AND (
token = 'U3sTVVi2xh0Nyo6LUgDTdcyQgzNSTQw9o9n/AXu9m94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)