UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GDl2cVTQOSpQRrYnAaz8hk+MLoZG8RIQVIQ6whUj+6s='
WHERE
key_id = '2677dd7f0f1ed4ae5dd80571797f308e5c098e4360b12da641b89b716a799eb5'
AND (
token = 'GDl2cVTQOSpQRrYnAaz8hk+MLoZG8RIQVIQ6whUj+6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)