UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XUQuXRaCSwGK7LghUfJ+N7YtUz5MF4GjpD80HqwQXDQ='
WHERE
key_id = '2ad6a51fca52bba618788d2c53e88cfede5bef5740970794e2a481a6093972c2'
AND (
token = 'XUQuXRaCSwGK7LghUfJ+N7YtUz5MF4GjpD80HqwQXDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)