UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RSD4rFrCkZboBRPkl2ouMxAGzQq9MBm65lb28WHOsOE='
WHERE
key_id = '28b3bcd549220374959d61eb36b2286ff501b0acb63f990026c143df54cdd047'
AND (
token = 'RSD4rFrCkZboBRPkl2ouMxAGzQq9MBm65lb28WHOsOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)