UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z/ERiC9WPdkCKAkdYXU4hUSQytxddIoVAGc82GeoSXg='
WHERE
key_id = '5a3c9701d18fb30b61bd84abf42455b310d0e7c267a40c861eac8f35ee01cb22'
AND (
token = 'z/ERiC9WPdkCKAkdYXU4hUSQytxddIoVAGc82GeoSXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)