UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IEbgUcF6Gh/YBXCxLbjKmmaM+kl3ZYn3+dUIag1cgac='
WHERE
key_id = '9d19c71d14fca42962a595a7abe8876c379a4dd3bbba18ba689eb4ba3063f26c'
AND (
token = 'IEbgUcF6Gh/YBXCxLbjKmmaM+kl3ZYn3+dUIag1cgac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)