UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z2gscmQQMFmUvjojZPnVpkaHQY8O4GB+D/p3S215hO8='
WHERE
key_id = '9ba343bef605b45bb3aafc24ae8a6e4ba1117f00554388b34cf16edf208a85a9'
AND (
token = 'z2gscmQQMFmUvjojZPnVpkaHQY8O4GB+D/p3S215hO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)