UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/0ewpwExZTQcwhVnEKwLZPBjYrt70YlWQF0McYtLgls='
WHERE
key_id = 'f16cb8721f43b829f6c5c12f1d89492fff2cc369a66fbb0d6e1ff46194db0e02'
AND (
token = '/0ewpwExZTQcwhVnEKwLZPBjYrt70YlWQF0McYtLgls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)