UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dwhp4xKBhxp1HxOtKAO1iIxx+ykbnSqUZk81itaeL6Q='
WHERE
key_id = '712cac39bfb8c3817e917113a6e709748c10d774590d61afbddec3c710145650'
AND (
token = 'dwhp4xKBhxp1HxOtKAO1iIxx+ykbnSqUZk81itaeL6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)