UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9dRQUvJBS84qSgfKE7v/7i5LY3Elykf/z4JNf5Sgdac='
WHERE
key_id = '87e30a0fcce9da0a5d2a1ad6009ec07fc6ce0c5f82663cc58b385d441e026239'
AND (
token = '9dRQUvJBS84qSgfKE7v/7i5LY3Elykf/z4JNf5Sgdac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)