UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wTIKN/00gxoI1r+RSICjYp6NJjz5ujuAqAkqcjET22M='
WHERE
key_id = 'de942a7e5b6b80c7fcae896bdb32ffc7b1bf8870f3baa9aa65007c57f07aa8d2'
AND (
token = 'wTIKN/00gxoI1r+RSICjYp6NJjz5ujuAqAkqcjET22M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)