UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VbMmDSP1LAYS7RTV8s4I91dCCtPNCUbpuR39EXPkrkA='
WHERE
key_id = '8efe633ce6928ed2fd4f896e6dc542b91522f25c2549f2fc89bc3bd21ef14421'
AND (
token = 'VbMmDSP1LAYS7RTV8s4I91dCCtPNCUbpuR39EXPkrkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)