UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WokLFFcMO+ML92YrPHJAJhVHNkRcdgPGB3Hg90g5fUQ='
WHERE
key_id = '7211906cde39d1c7d546eabecc3c0258c61683fa1a1185fa7c5b944a8f8ea9fc'
AND (
token = 'WokLFFcMO+ML92YrPHJAJhVHNkRcdgPGB3Hg90g5fUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)