UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HDTUTwFDFbh2n5HUpuKKOPK1IU2gHJMdUfwDZJz+BQ4='
WHERE
key_id = '644e77cdcf5a3d2004d6b729441c0357957488e80ee377f5a07dc397c75b8f80'
AND (
token = 'HDTUTwFDFbh2n5HUpuKKOPK1IU2gHJMdUfwDZJz+BQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)