UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V1YA8JLkSu7Liav0CmhT2MSfWrKS0duSzKhTLIxRWKY='
WHERE
key_id = '28839ee76fce28c9624e1c88a2abb785e6eee9900d8b3be5046bb41d5ad05f89'
AND (
token = 'V1YA8JLkSu7Liav0CmhT2MSfWrKS0duSzKhTLIxRWKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)