UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CwlXe9dN4a9vxF6G43cpPMaB7ijWRjqk9bqUtSsTGcU='
WHERE
key_id = '844a9bcbabb82f9c7811d05c857dc603cf7a648d8ef53005fb00adfb941d7649'
AND (
token = 'CwlXe9dN4a9vxF6G43cpPMaB7ijWRjqk9bqUtSsTGcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)