UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/KBlJw7UY4CD/PiizgpXMVFNHYdWuiS3W9McELVQrkw='
WHERE
key_id = '199cdb8046fce6af24b1e3987c8dcd6843edd01de024474f20caea3d2625b22a'
AND (
token = '/KBlJw7UY4CD/PiizgpXMVFNHYdWuiS3W9McELVQrkw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)