UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OMKPjNtN+WZXf3e4u7zkqk8Mcz32217/nRAl32ePWPE='
WHERE
key_id = 'd68d3aa049929b3b3479814aa4de421ef20e29452bc4d321e3fd6d75b587b519'
AND (
token = 'OMKPjNtN+WZXf3e4u7zkqk8Mcz32217/nRAl32ePWPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)